package com.uchiha.nova.core.logger;


import com.uchiha.nova.core.publisher.UsualLogPublisher;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Value;

/**
 * @author 周林静
 * @Date 2021-10-26 9:17
 * @Version 1.0
 */
public class NovaLogger implements InitializingBean {

    @Value("${spring.application.name}")
    private String serviceId;

    public void info(String id, String data) {
        UsualLogPublisher.publishEvent("info", id, data);
    }

    public void debug(String id, String data) {
        UsualLogPublisher.publishEvent("debug", id, data);
    }

    public void warn(String id, String data) {
        UsualLogPublisher.publishEvent("warn", id, data);
    }

    public void error(String id, String data) {
        UsualLogPublisher.publishEvent("error", id, data);
    }

    @Override
    public void afterPropertiesSet(){
        System.out.println("NovaLogger init success!");
    }

}


